# !/usr/bin/env python
# -*- coding:utf-8 -*-

# https://www.cnblogs.com/Kobe10/p/5712233.html

import tkinter


class App:
    def __init__(self, master):  # maseter 根窗体的一个实例
        frame = tkinter.Frame(master)  # frame是在root  window上的东西,父窗体是root  windows
        frame.pack()  # 显示

        # Button是frame上面的东西
        self.button = tkinter.Button(frame, text='Hello class', fg='red', command=frame.quit)  # frame上面有一个button
        self.button.pack()  # 显示

        self.hiButton = tkinter.Button(frame, text='say hi', command=self.say_hi)
        self.hiButton.pack()  # 显示

    def say_hi(self):
        print('hi fuzhiqiang,thanks!')


def main():
    root = tkinter.Tk()
    root.title("Button")
    root.geometry('1000x618')  # 是x 不是*
    root.resizable(width=False, height=False)  # 宽可变, 高可变
    app = App(root)
    root.mainloop()


if __name__ == "__main__":
    main()
